package com.kk.crowd.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CrowdWebMvcConfig implements WebMvcConfigurer {

    // 配置Controller 转发地址
    public void addViewControllers(ViewControllerRegistry registry) {
        // 浏览器访问地址
        String urlPath = "/auth/member/to/reg/page";

        // 视图访问地址
        String viewName = "member-reg";

        // 添加一个view-controller
        registry.addViewController (urlPath).setViewName (viewName);
        registry.addViewController ("/auth/member/to/login/page").setViewName ("member-login.html");
        registry.addViewController("/auth/member/to/center/page").setViewName("member-center");
        registry.addViewController("/member/my/crowd").setViewName("member-crowd");
    }
}
